package com.frankghost.le.ffmpegvideoplay;

import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.SurfaceView;
import android.view.View;
import android.widget.TextView;

import java.io.File;

public class MainActivity extends AppCompatActivity {

    SurfaceView surfaceView;
    private MediaPlay mediaPlay;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        surfaceView = (SurfaceView) findViewById(R.id.surface);
        mediaPlay = new MediaPlay();
        mediaPlay.setSurfaceView(surfaceView);
    }

    public void stop(View view) {
        mediaPlay.release();
    }

    public void player(View view) {
        File file = new File(Environment.getExternalStorageDirectory(), "Warcraft3_End.avi");
        mediaPlay.playJava("http://112.74.178.77:8080/input.mp4");
//        mediaPlay.playJava(file.getPath());
    }
}
